package net.ikenna.yadet.core.rowprocessor;

import net.ikenna.yadet.core.cellprocessor.*;
import net.ikenna.yadet.core.data.*;
import org.apache.log4j.*;

public class SimpleRowProcessor implements RowProcessor {
    private Logger logger = Logger.getLogger(SimpleRowProcessor.class);
    private CellProcessor cellProcessor;
    private DataLogger dataLogger;

    public SimpleRowProcessor(CellProcessor cellProcessor, DataLogger dataLogger) {
        this.cellProcessor = cellProcessor;
        this.dataLogger = dataLogger;
    }

    public RowSet process(RowSet rowSet) {
        RowSet processedRowSet = rowSet.processWith(cellProcessor);
        dataLogger.log("[Printing processed rowSet]", processedRowSet, logger);
        return processedRowSet;                                         
    }
}